import React from 'react';
import Link from 'umi/link';
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import styles from './PageHeaderLayout.less';

const screenHeight=document.documentElement.clientHeight-160 || document.body.clientHeight-160;

export default ({  children, wrapperClassName, top, ...restProps }) => (
  <div style={{minHeight: screenHeight}} className={wrapperClassName}>
    {top}
    <PageHeaderWrapper {...restProps} linkElement={Link} >
    {children ? <div className={styles.content}>{children}</div> : null}
    </PageHeaderWrapper>
  </div>
);
